from sqlalchemy import Column, Integer, ForeignKey, String, Float, JSON

from models import Base


class TestReport(Base):
    id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    project_name = Column(String(100), comment="项目名称")
    test_count = Column(Integer, comment="已测试次数")
    pass_count = Column(Integer, comment="测试通过次数")
    failed_count = Column(Integer, comment="测试失败次数")
    pass_rate = Column(String(10), comment="测试通过率")
    come_from = Column(String(100), comment="测试来源")
    execute_nickName = Column(String(100), comment="执行人")
    corn_id = Column(Integer, comment="定时任务ID")
    total_test_spending_time = Column(Float(10), comment="测试总耗时")
    test_domain = Column(String(100), comment="测试域名")

    project_id = Column(Integer, ForeignKey('project.id', ondelete="CASCADE"), nullable=False, comment="项目ID")
